repeat 
 if isTouched(1) then
 forward (A)
 forward (B, 50)
 elseif isTouched(2) then
 backward (A)
 backward (B, 20)
 else 
   forward(A)
   forward(B)
 end
 until rotationCounts(A) > 9000
 forward (A,80)
 forward (B,100)
repeat
 if isTouched(1) then
 forward (A)
 forward (B, 50)
 elseif isTouched(2) then
 backward (A)
 backward (B, 20)
 else 
   forward(A)
   forward(B)
 end
 until rotationCounts(A) > 20000
 forward (A)
 forward (B)
repeat
 if isTouched(1) then
 forward (A)
 forward (B, 50)
 elseif isTouched(2) then
 backward (A)
 backward (B, 20)
 else 
   forward(A)
   forward(B)
 end
 until rotationCounts(A) > 29000
stop (A)
stop (B)











